package com.icarsaas.saas.master.model;

import com.icarsaas.saas.component.base.DataEntity;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author xrong120@gmail.com
 * @title: Customer
 * @projectName icarsaas
 * @description: 租户默认设置
 * @date 2022/1/2211:47
 */
@Entity @Data
@Table(name = "master_tenant_detail")
@EntityListeners(AuditingEntityListener.class)
@DynamicInsert @DynamicUpdate
@org.hibernate.annotations.Table(appliesTo = "master_tenant_detail",comment="租户默认设置")
public class MasterTenantDetail extends DataEntity implements Serializable {

    @Id @GeneratedValue(generator="system-uuid")
    @GenericGenerator(name="system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
    @Column(name = "id", nullable = false, insertable = true, updatable = true, length = 36)
    private String id;
    @Column(name = "skin", columnDefinition="varchar(30) COMMENT '租户默认皮肤'")
    private String skin = "skin-red";
    @Column(name = "enable_nav", columnDefinition="char(1) COMMENT '是否开启顶端导航'")
    private Boolean enableNav = false;
    @Column(name = "logo", columnDefinition="varchar(200) COMMENT 'logo图片地址'")
    private String logo;

    @OneToOne @JoinColumn(name = "master_id", columnDefinition="bigint COMMENT '关联的租户ID'")
    private MasterTenant masterTenant;
}